package com.ruoyi.common.core.utils;

import java.util.concurrent.ThreadLocalRandom;

/**
 * 编号生成器工具类
 * 
 * @author ruoyi
 */
public class NoUtils {

    /**
     * 获取随机编号
     * @return 随机编号
     */
    public static String randomNo() {
        String timeNow = DateUtils.dateTimeNow();
        return timeNow + generateNumber(3);
    }

    // N为随机数流水号
    private static String generateNumber(final int num) {
        StringBuffer sb = new StringBuffer();
        for (int i = 1; i <= num; i++) {
            sb.append(ThreadLocalRandom.current().nextInt(9));
        }
        return sb.toString();
    }

}
